<% cache("topics/grid/#{date_slug(@cur_month)}", :tag => 'session-info')  do %>
  <table id="topic-grid">
    <caption>
      <%= link_to "◄", "/topics/grid/#{@cur_month.prev_month.year}/#{@cur_month.prev_month.month}" %>
      <%= @cur_month.strftime('%B %Y') %>
      <%= link_to "►", "/topics/grid/#{@cur_month.next_month.year}/#{@cur_month.next_month.month}" %>
    </caption>
    <thead>
      <tr>
        <% (0...7).each do |day| %>
          <th><%=t(:'date.day_names')[day] %></th>
        <% end %>
      </tr>
    </thead>
    <tbody>
      <% @occurrences = in_month(@cur_month) %>
      <% full_month(@cur_month).in_groups_of(7).each do |week| %>
        <tr>
          <% week.map do |day| %>
            <td class="<%= date_class(day, @cur_month) %>">
              <div class="day">
                <%= day.day %>
              </div>
              <div class="grid-cell-topic-list">
                <% if @occurrences.has_key? day %>
                  <% reset_cycle %>
                  <% @occurrences[day].each do |occurrence| %>
                    <% cache(["topics/grid/#{date_slug(day)}", occurrence], :tag => occurrence.cache_key) do %>
                      <div class="session <%= cycle("odd", "even") -%>">
                        <%= link_to occurrence.session.topic.name, occurrence.session, :title => occurrence.session.topic.name %>
                      </div>
                    <% end %>
                  <% end %>
                <% end %>
              </div>
            </td>
          <% end %>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>
